package com.atguigu.ext;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

/**
 * @Description :
 * @Author : guxuemin
 * @Version : V1.0.0
 * @Date : 2022/9/18 19:30
 */
@Service
public class MyEventListenerService {

    @EventListener(ApplicationEvent.class)
    public void handleEvent(ApplicationEvent event){
        System.out.println("handleEvent thread start:" + Thread.currentThread().getName() + ", time:" + System.currentTimeMillis());
        System.out.println("handler event:{}" + event);
        System.out.println("handleEvent thread end:" + Thread.currentThread().getName() + ", time:" + System.currentTimeMillis());
    }
}
